package com.xinqi.modules.sys.sensitive.word.controller.inner;

import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.sys.sensitive.word.client.SensitiveWordClient;
import com.xinqi.modules.sys.sensitive.word.dto.req.SensitiveWordQueryDTO;
import com.xinqi.modules.sys.sensitive.word.dto.rsp.SensitiveWordResultDTO;
import com.xinqi.modules.sys.sensitive.word.service.SensitiveWordService;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.RestController;


/**
 * 敏感词管理表内部控制层
 *
 * @author: wenjie
 * @date: 2023/08/02
 */
@Hidden
@Primary
@RestController
@RequiredArgsConstructor
public class SensitiveWordInnerController implements SensitiveWordClient {
    private final SensitiveWordService sensitiveWordService;

    @Override
    public R<PageInfo<SensitiveWordResultDTO>> page(SensitiveWordQueryDTO dto) {
        PageInfo<SensitiveWordResultDTO> page = sensitiveWordService.page(dto, dto);
        return R.data(page);
    }

    @Override
    public R<SensitiveWordResultDTO> findById(Long id) {
        SensitiveWordResultDTO dto = sensitiveWordService.findById(id);
        return R.data(dto);
    }
}
